<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<title>登录1</title>
<meta name="renderer" content="webkit">
<meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
<meta name="viewport"
	content="width=device-width, initial-scale=1, maximum-scale=1">
<meta name="apple-mobile-web-app-status-bar-style" content="black">
<meta name="apple-mobile-web-app-capable" content="yes">
<meta name="format-detection" content="telephone=no">
<link rel="stylesheet" href="#(ctx)/static/layui/css/layui.css">
<link rel="stylesheet" type="text/css"
	href="#(ctx)/admin/css/pageDemo/login/login1.css" />
</head>

<body>
	<div class="qiqiu1 qiqiu">
		<img src="#(ctx)/admin/img/login/login1/q2.png" />
		<div class="text">love</div>
	</div>
	<div class="qiqiu2 qiqiu">
		<img src="#(ctx)/admin/img/login/login1/q3.png" />
		<div class="text">love</div>
	</div>
	<div class="qiqiu3 qiqiu">
		<img src="#(ctx)/admin/img/login/login1/q4.png" />
		<div class="text">love</div>
	</div>
	<div class="qiqiu4 qiqiu">
		<img src="#(ctx)/admin/img/login/login1/q5.png" />
		<div class="text">love</div>
	</div>
	<div class="qiqiu5 qiqiu">
		<img src="#(ctx)/admin/img/login/login1/q6.png" />
		<div class="text">love</div>
	</div>

	<div class="login">
		<h1>新途新闻源发布系统管理后台</h1>
		<form class="layui-form" lay-filter="loginForm" id="loginForm"
			onSubmit="return false;">
			<div class="layui-form-item">
				<input class="layui-input" name="uname" placeholder="用户名"
					lay-verify="required" type="text" autocomplete="off">
			</div>
			<div class="layui-form-item">
				<input class="layui-input" name="password" placeholder="密码"
					lay-verify="required" type="password" autocomplete="off">
			</div>
			<div class="layui-form-item form_code">
				<input class="layui-input" name="code" placeholder="验证码"
					lay-verify="required" type="text" autocomplete="off">
				<div class="code">
					<img src="#(ctx)/admin/admin/captcha?date=" width="116" height="36"
						id="code" onclick="this.src=this.src+new Date()">
				</div>
			</div>
			<button class="layui-btn login_btn" lay-submit="" lay-filter="login">登录</button>
		</form>
	</div>

</body>

<script src="#(ctx)/static/layui/layui.js"></script>

<script>
	layui.use('form', function() {
		var form = layui.form, $ = layui.jquery;
		form.on('submit(loginForm)', function(data) {
			$.ajax({
				url : "#(ctx)/admin/admin/doLogin",
				type : "POST",
				data : $('#loginForm').serialize(),
				dataType : "JSON",
				success : function(data) {
					layer.msg(data.msg);
					if (data.hasOwnProperty("code") && data.code) {
						window.location.href = "#(ctx)/admin/admin/home";
					} else {
						$("#code").click();
					}
				},
				error : function(data) {
					layer.msg(data.msg);
				}
			});
		});
	});
</script>
</body>
</html>
